/*
 * IString.h
 *
 *  Created on: Oct 9, 2013
 *      Author: alexandru
 */

#ifndef ISTRING_H_
#define ISTRING_H_

#include <iostream>
#include <algorithm>
#include <string.h>

namespace stn {
using namespace std;
class IString {


private:
	char * cstr;


public:
	IString();
	IString(char * source);



	IString operator=(char * source){
		IString tmp(*this);
		cstr=new char[strlen(source)+1];
		strcpy(cstr, source);
		return tmp;
	};

	IString operator=(std::string strSource){
			const char * source=strSource.c_str();
			IString tmp(*this);
			cstr=new char[strlen(source)+1];
			strcpy(cstr, source);
			return tmp;
		};


//	   bool operator==(const IString  *as, const char *cs){
//
//	   };



	IString& operator=(IString& other) // copy assignment
	{

		cout << "overloaded" << endl;
		return other;
	}




	char * getSource(){
		return cstr;
	}

//		IString& operator=(std::string strSource){
//				const char * source=strSource.c_str();
//				cstr=new char[strlen(source)+1];
//				strcpy(cstr, source);
//				return *this;
//			};




	void describe();

	virtual ~IString();
};

} /* namespace stn */
#endif /* ISTRING_H_ */
